// ED2dVertex.cpp: implementation of the ED2dVertex class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ED2dVertex.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

ED2dVertex::ED2dVertex()
{
}

ED2dVertex::~ED2dVertex()
{
}

ED2dVertex::ED2dVertex ( const ED2dVertex& vrt )
	: m_ptPos ( vrt.m_ptPos ), m_arc ( vrt.m_arc )
{
}

ED2dVertex::ED2dVertex ( const EDPoint3d& pt, const EDAngle& arc )
	: m_ptPos ( pt ), m_arc ( arc )
{
}

ED2dVertex::ED2dVertex (
	const CString& pt0,
	const CString& pt1,
	const CString& pt2,
	const CString& arc )
	: m_ptPos ( pt0, pt1, pt2 ), m_arc ( arc )
{
}

ED2dVertex& ED2dVertex::operator = ( const ED2dVertex& vet )
{
	m_ptPos = vet.m_ptPos;
	m_arc = vet.m_arc;

	return *this;
}

BOOL ED2dVertex::HasArc()
{
	return !m_arc.IsEmpty();
}

BOOL ED2dVertex::IsSingleDigital()
{
	if ( !EDSQLExpression::IsSingleDigitalVar ( &m_arc.m_val ) )
		return FALSE;

	return m_ptPos.IsSingleDigital();
}

void ED2dVertex::Replace ( const CVarArray* pVarAr, const int nStart )
{
	m_arc.Replace ( pVarAr, nStart );
	m_ptPos.Replace ( pVarAr, nStart );
}

void ED2dVertex::Set (
	const CString& pt0,
	const CString& pt1,
	const CString& pt2,
	const CString& arc )
{
	m_ptPos.x = pt0;
	m_ptPos.y = pt1;
	m_ptPos.z = pt2;
	m_arc = arc;
}